﻿#pragma once
#include "Board.h"

// 回合帧frame, 包含一个回合的所有信息
class Frame
{
public:
    int red_score; //红方当前分
    int blue_score; //蓝方当前分
    int turn; //当前是谁的回合
    Board* cur_board;
    int size = 0; // 不知道代表啥, 冗余信息吧, 可以删的

    Frame(int turn, int red_score, int blue_score, Board* cur_board, int size = 0)
    {
        this->turn = turn;
        this->red_score = red_score;
        this->blue_score = blue_score;
        this->cur_board = cur_board;
        this->size = size;
    }

    Frame(int turn, Board* cur_board)
    {
        this->turn = turn;
        this->red_score = cur_board->getScore(RED_);
        this->blue_score = cur_board->getScore(BLUE_);
        this->cur_board = cur_board;
    }

    int toggle_round(int turn) {
        if (turn == RED_)
            return BLUE_;
        else
            return RED_;
    }

    size_t get_hash()
    {
        return cur_board->get_hash(turn);
    }

    ~Frame()
    {

    }
};
